package com.lord.base.design.observer;
/**
 * 观察者模式
 * @author xj_xiaocheng
 *
 */
public class ObserverClient {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		ConcreteSubject s = new ConcreteSubject();
		
		s.attach(new ConcreteObserver("来了", s));
		s.attach(new ConcreteObserver("走了", s));
		
		s.setSubjectState("回来");
		s.notifyall();
		
	}

}
